package com.fubowen.lepton.ui.container

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.fubowen.lepton.ui.container.children.bookmark.BookmarkFragment
import com.fubowen.lepton.ui.container.children.download.DownloadFragment
import com.fubowen.lepton.ui.container.children.visited.VisitedFragment

class TabAdapter(fa: FragmentActivity) : FragmentStateAdapter(fa) {

    override fun getItemCount(): Int = 3

    override fun createFragment(position: Int): Fragment {
        return when (position) {
            0 -> BookmarkFragment()
            1 -> VisitedFragment()
            else -> DownloadFragment()
        }
    }
}